//
//  ProjectTabView.m
//  ProjectA_LK
//
//  Created by 萌萌的小坤坤 on 16/6/15.
//  Copyright © 2016年 冷坤. All rights reserved.
//

#import "ProjectTabView.h"
#import "UIImageView+WebCache.h"
@implementation ProjectTabView

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatTabView];
    }
    return self;
}
- (void)creatTabView{
    self.picImage = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, [UIScreen mainScreen].bounds.size.width - 20, 667 / 3.5)];
    self.picImage.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.picImage];
    [_picImage release];
    
    
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, self.picImage.frame.size.height - 30, self.picImage.frame.size.width, 20)];
    self.titleLabel.font = [UIFont systemFontOfSize:15];
    self.titleLabel.textColor = [UIColor whiteColor];
    //    self.titleLabel.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.titleLabel];
    [_titleLabel release];
}

- (void)setModel:(ProjectModel *)model{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    
    
    [self.picImage sd_setImageWithURL:[NSURL URLWithString:model.pic]];
    self.titleLabel.text = model.subject;

}

@end
